package com.sharp.authorization.dao.join.repository;

import com.sharp.authorization.dao.join.entity.UserWithRoleList;
import com.sharp.authorization.dao.join.mapper.UserJoinRoleDao;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;

/**
 * Title: UserJoinRoleService
 * Description: Copyright: Copyright (c) 2019 Company: BHFAE
 *
 * @author Sharp
 * @date 2019/10/5 21:53
 */
@Service
public class UserJoinRoleService {

    @Resource
    private UserJoinRoleDao userJoinRoleDao;

    public UserWithRoleList getUserWithRoleListByUserId(String userId) {
        return userJoinRoleDao.selectUserWithRoleList(userId, null, null, null, null);
    }

    public UserWithRoleList getUserWithRoleListByLoginId(String loginId) {
        return userJoinRoleDao.selectUserWithRoleList(null, loginId, null, null, null);
    }

    public UserWithRoleList getUserWithRoleListByWechatId(String wechatId) {
        return userJoinRoleDao.selectUserWithRoleList(null, null, null, wechatId, null);
    }

    public UserWithRoleList getUserWithRoleListByPhoneNumber(String phoneNumber) {
        return userJoinRoleDao.selectUserWithRoleList(null, null, null, null, phoneNumber);
    }

    public UserWithRoleList getUserWithRoleListByCustomerNumber(String customerNumber) {
        return userJoinRoleDao.selectUserWithRoleList(null, null, customerNumber, null, null);
    }
}
